import { Injectable } from '@nestjs/common';
import { Profile } from 'src/user/interface/profile.interface';
import { Mod } from 'src/utils/model';

@Injectable()
export class RanklingListService {
  async getListByTomato(limit: number) {
    const model = new Mod('users');
    const data = await model.find<Profile>(
      {},
      {
        sort: {
          'property.tomato': -1,
        },
        limit,
      },
    );

    return data;
  }
}
